<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function Person(name, age, gender){
    //向对象中添加属性
    this.name = name;
    this.age = age;
    this.gender = gender;
}

let obj1 = new Person('小明',12,'男')

let obj2 = new Person('小红',10,'女')

Person.prototype.sayName = function(){
    console.log(123)
}

//调试

// console.log(obj2.sayName)
</script>
</html>